TreeGrid Paging Tutorial
2. Client child paging in tree
Automatic paging of child rows in tree on client side
-
There are three independent ways, how to page children in tree.
None of the method affect root rows, they affect only children of some parent rows.
-
Render children on expand
by Cfg attribute ChildPaging
='2'.
The parent rows must be collapsed (must have set Expanded='0') to take the child paging effect.
To collapse all rows in grid define <Def><D Name='R' Expanded='0'/></Def>.
It is default setting, the ChildPaging is set to 2 by default.
The children are rendered only on first expand.
To not slow the grid if there are too many children rendered, set RemoveCollapsed='2' to remove the rendered children on collapse and render them on every expand.
-
Render children on scroll
by Cfg attribute ChildParts
='2'.
It renders children when they become visible by scrolling, similarly to root pages. It can render only subset of children of one parent.
The count of children rendered at once (the size of the part) is set by Cfg attribute ChildPartLength.
When the parent is expanded or expanding, it can render immediately few first children to speed the rendering. Their count is set by Cfg attribute ChildPartMin.
When grid has too many rendered rows, it can be slow. It is possible to remove unused child parts by setting MaxChildParts attribute.
It is also possible to render all children on start or on expand, but with progress dialog to cancel the rendering and render the rest on demand, for this behavior set ChildParts='1'. See the second icon on toolbar.
-
Group children to sub parents
by row attribute MaxChildren
.
When row children count exceeds its MaxChildren value, there are created new sub rows and the children are grouped to these rows, by MaxChildren count.
To not group children with count only few rows above MaxChildren set MaxChildrenDiff, the rows are grouped after the count is higher than MaxChildren+MaxChildrenDiff.
Some attributes of the newly created row can be specified in default row named CPage (<D Name='CPage' ... />).